//
//  CQAddView.m
//  HiChat
//
//  Created by DLS151034-38 on 16/1/16.
//  Copyright © 2016年 wqiong. All rights reserved.
//

#import "CQAddView.h"

@interface CQAddView ()
@property (nonatomic, retain) UIButton *buttonPhoto;
@end

@implementation CQAddView

- (void)dealloc {
    [_buttonPhoto release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.buttonPhoto.frame = CGRectMake(5, 5, 50, 50);
}

- (void)createSubviews {
    self.buttonPhoto = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.buttonPhoto setBackgroundImage:[UIImage imageNamed:@"chatBar_colorMore_photo@2x.png"] forState:UIControlStateNormal];
    [self.buttonPhoto addTarget:self action:@selector(photoAction) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.buttonPhoto];
}

- (void)photoAction {
    [self.delegate photoDelegate];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
